package com.woniuxy.dao;

import com.woniuxy.model.Resource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Kevin Martin
 * @since 2022-03-17
 */



public interface ResourceDao extends BaseMapper<Resource> {
    @Select("SELECT\n" +
            "wr.resource_uri\n" +
            "\n" +
            "from woniu_account_rule war\n" +
            "join woniu_rule_resource wrr\n" +
            "JOIN woniu_resource wr\n" +
            "on war.rule_id=wrr.rule_id\n" +
            "AND wrr.resource_id=wr.resource_id\n" +
            "where war.account_id=2")
    List<String> getResourceUriList(Integer accountId);
}
